package com.linkage.jz.bankruptcy.fragment.Vote;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.TextView;

import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.widget.ShapeLoadingDialog;

public class ProVoteBaseFragment extends Fragment {

    private ShapeLoadingDialog shapeLoadingDialog;
    protected View emptyText;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        shapeLoadingDialog = new ShapeLoadingDialog(getActivity());
        emptyText = new TextView(getActivity());
        ((TextView) emptyText).setText("暂无数据");
        ((TextView) emptyText).setTextColor(getResources().getColor(R.color.darker_gray));
        ((TextView) emptyText).setTextSize(20);
        ((TextView) emptyText).getPaint().setFakeBoldText(true);//加粗
    }

    protected void showLoading() {
        if(null != shapeLoadingDialog) {
            shapeLoadingDialog.setLoadingText("加载中...");
            shapeLoadingDialog.setCanceledOnTouchOutside(false);
            shapeLoadingDialog.show();
        }
    }

    protected void hideLoading() {
        if(null != shapeLoadingDialog) {
            shapeLoadingDialog.dismiss();
        }
    }
}
